home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / glibc108.zip / glibc108 / malloc / Makefile < prev    next >
Makefile  |  1994-05-03  |  3KB  |  103 lines

  1. # Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
  2. # This file is part of the GNU C Library.
  3.  
  4. # The GNU C Library is free software; you can redistribute it and/or
  5. # modify it under the terms of the GNU Library General Public License as
  6. # published by the Free Software Foundation; either version 2 of the
  7. # License, or (at your option) any later version.
  8.  
  9. # The GNU C Library is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. # Library General Public License for more details.
  13.  
  14. # You should have received a copy of the GNU Library General Public
  15. # License along with the GNU C Library; see the file COPYING.LIB.  If
  16. # not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  17. # Cambridge, MA 02139, USA.
  18.  
  19. #
  20. #    Makefile for malloc routines
  21. #
  22. subdir    := malloc
  23.  
  24. all: 
  25.  
  26. dist-headers := malloc.h
  27. headers := $(dist-headers) obstack.h
  28. tests := mallocbug
  29.  
  30. # Things which get pasted together into gmalloc.c.  It is important that
  31. # valloc is first, so that getpagesize.h is included before other things.
  32. gmalloc-routines := valloc malloc free cfree realloc calloc morecore memalign 
  33. # Things to include in the standalone distribution.
  34. dist-routines = $(gmalloc-routines) \
  35.         mcheck mtrace mstats vm-limit ralloc
  36. routines = $(dist-routines) obstack
  37.  
  38. # Frob these guys' copying notices.
  39. gpl2lgpl := obstack.c obstack.h vm-limit.c mem-limits.h ralloc.c
  40.  
  41. install-lib := libmcheck.a
  42. non-lib.a := libmcheck.a
  43.  
  44. distribute := mcheck-init.c OChangeLog TODO \
  45.           malloc/gmalloc-head.c dist-README dist-Makefile \
  46.           mtrace.awk mem-limits.h getpagesize.h
  47.  
  48. # These should be removed by `make clean'.
  49. extra-objs = mcheck-init.o libmcheck.a
  50.  
  51.  
  52. # Make the standalone malloc distribution.
  53. malloc-dist := README COPYING.LIB Makefile ChangeLog OChangeLog \
  54.            $(addsuffix .c,$(dist-routines)) $(dist-headers) \
  55.            getpagesize.h mem-limits.h gmalloc.c \
  56.            gmalloc-head.c mtrace.awk
  57. %.uu: %
  58.     uuencode $< < $< > $@-tmp
  59.     mv -f $@-tmp $@
  60. %.Z: %
  61.     compress -c $< > $@-tmp
  62.     mv -f $@-tmp $@
  63. %.gz: %
  64.     gzip -9 -v -c $< > $@-tmp
  65.     mv -f $@-tmp $@
  66.  
  67. malloc.tar: $(addprefix malloc/,$(malloc-dist))
  68.     tar cho$(verbose)f $@ $^
  69.  
  70. malloc/ChangeLog: ../ChangeLog
  71.     changelog-extract --regexp 'malloc/.*' < $< > $@.new
  72.     (echo ''; echo 'Find older changes in OChangeLog.') >> $@.new
  73.     chmod a-w $@.new
  74.     mv -f $@.new $@
  75.  
  76. malloc/Makefile: dist-Makefile Makefile
  77.     sed -e 's,<GMALLOC-SOURCES>,$(addsuffix .c,$(gmalloc-routines)),' \
  78.         -e 's,<DIST-SOURCES>,$(addsuffix .c,$(dist-routines)),' \
  79.         -e 's,<DIST-OBJECTS>,$(addsuffix .o,$(dist-routines)),' \
  80.         -e 's,<DIST-HEADERS>,$(dist-headers),' < $< > $@-tmp
  81.     mv -f $@-tmp $@
  82. # Make it unwritable to avoid accidentally changing the file,
  83. # since it is generated and any changes would be lost.
  84.     chmod a-w $@
  85. malloc/gmalloc.c: malloc/Makefile \
  86.           $(addprefix malloc/,$(headers) \
  87.                             $(addsuffix .c,$(dist-routines)))
  88.     $(MAKE) -C malloc gmalloc.c
  89. malloc/README: dist-README
  90.     @rm -f $@
  91.     cp $< $@
  92. malloc/%: %
  93.     @rm -f $@
  94.     cp $< $@
  95.  
  96. include ../Rules
  97.  
  98. $(objpfx)libmcheck.a: $(objpfx)mcheck-init.o
  99.     -rm -f $@
  100.     ln $< $@
  101.  
  102. lib: $(objpfx)libmcheck.a
  103.